#include "CheckBoxInput.h"


CheckBoxInput::CheckBoxInput(int x, int y, std::string prp)
{
	prop = prp;
	outer = new SDL_Rect();
	outer->x = x;
	outer->y = y;
	outer->h = 32;
	outer->w = 32;
	inner = new SDL_Rect();
	inner->h = 28;
	inner->w = 28;
	inner->x = x+2;
	inner->y = y+2;
	isActive = false;
	isChecked=false;
	value = "false";
}


CheckBoxInput::~CheckBoxInput(void)
{
}

void CheckBoxInput::onClick() 
{
	isChecked = !isChecked;
	if(isChecked)
		value = "true";
	else
		value = "false";
}

	void CheckBoxInput::drawElement(SDL_Surface* screen)
	{
	
		SDL_FillRect( screen, outer, SDL_MapRGB( screen->format, 0x00, 0x00, 0x00 ) );
		SDL_FillRect( screen, inner, SDL_MapRGB( screen->format, 0x33, 0x33, 0x33 ) );
		if(isChecked)
		{
		SDL_FillRect( screen, inner, SDL_MapRGB( screen->format, 0x00, 0xFF, 0x00 ) );
		}
	}
	void CheckBoxInput::handleInput(SDL_Event event)
	{
		//do nothing
	}
	void CheckBoxInput::onClickOut()
	{
		//do nothing
	}